<html>

<head>
	<link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/media/css/base.css">
	<link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/media/css/list.css">
	<link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/media/css/flexyclasslist.css">
	<script type="text/javascript" src="{{MEDIA_URL}}/media/js/jquery.js"></script>
	<script type="text/javascript" src="{{MEDIA_URL}}/media/js/sysmodel/flexyclass/home.js"></script>
</head>

<body>
	{% include "sysmodel/header.html" %}
	
	<div class="breadcrumbs">
		<a href="/sysmodel/home/">Home</a> &gt; List of FlexyClass
	</div>
	

	<table class="list-container" cellspacing="0">
		<tbody id="UI_CLASS_LIST">
			<tr>
				<td class="list-heading">	
					<h3>List of FlexyClass</h3>
				</td>
				<td class="list-tools">	
					<a href="/sysmodel/flexyclass/add/">add class</a>
					<a href="#">sort classes</a>
				</td>
			</tr>
		</tbody>
	</table>
	
	<div class="hidden">
		<ul id="DB_CLASS_LIST">
			{% for fc in flexyclasses %}
				<li flexyclass_id="{{fc.id}}">{{fc.name}}</li>	
			{% endfor %}
		</ul>
		<hr>
		<ul id="DB_GROUP_LIST">
			{% for g in groups %}
				<li group_id="{{g.id}}" flexyclass_id="{{g.flexyclass.id}}">{{g.name}}</li>
			{% endfor %}
		</ul>
		<hr>
		<ul id="DB_FIELD_LIST">
			{% for f in fields %}
				{% if f.extra_field_parent == None %}
					<li field_id="{{f.id}}" group_id="{{f.group.id}}" 
					fieldtype=
					"{{f.type}}{% if f.type == "NTO1" or f.type == "NTOM" %} [{{ f.sel_field.flexyclass.name }} &gt; {{ f.sel_field.name }}]
					{% endif %}">{{f.name}}</li>
				{% endif %}
			{% endfor %}
		</ul>
		
		<hr>
		<ul id="DB_DISPLAY_FIELD_LIST">
			{% for f in fields %}
				{% if f.type == 'NTO1' or f.type == 'NTOM' %}
					{% for df in f.display_fields.all %}
						<li parent_field_id="{{ f.id }}" self_field_id="{{ df.id }}">{{ df.name }}</li>
					{% endfor %}
				{% endif %}
			{% endfor %}
		</ul>
		
		<hr>
		<ul id="DB_EXTRA_FIELD_LIST">
			{% for f in fields %}
				{% if f.extra_field_parent != None %}
					<li self_field_id="{{f.id}}" fieldtype="{{f.type}}" 
						parent_field_id="{{ f.extra_field_parent.id }}">{{f.name}}</li>
				{% endif %}
			{% endfor %}
		</ul>
		
	</div>
	
</body>
</html>
